package bean;


import java.io.Serializable;

import javax.faces.bean.ManagedBean;

import metier.PhotoBusiness;

@ManagedBean
public class PhotoBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private String name;
	private String contentType;
	private byte [] content;
	private Integer length;
	private PhotoBusiness photoCourante;
	
	public PhotoBean() {
		super();
		photoCourante = new PhotoBusiness();
	}

		public String ajoutPhoto(){

		System.out.println("AJOUT PHOTO");
		photoCourante.save(this);

		return "ajoutPhoto";

	}

		public int getId() {
			return id;
		}

		public void setId(int id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getContentType() {
			return contentType;
		}

		public void setContentType(String contentType) {
			this.contentType = contentType;
		}

		
		public Integer getLength() {
			return length;
		}

		public void setLength(Integer length) {
			this.length = length;
		}

		public PhotoBusiness getPhotoCourante() {
			return photoCourante;
		}

		public void setPhotoCourante(PhotoBusiness photoCourante) {
			this.photoCourante = photoCourante;
		}

		/**
		 * @return the content
		 */
		public byte [] getContent() {
			return content;
		}

		/**
		 * @param content the content to set
		 */
		public void setContent(byte [] content) {
			this.content = content;
		}

}
